package com.kingdee.eas.xr.helper;
import com.kingdee.eas.util.client.EASResource;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.zip.*;
public class ReadFileInfoHelper {
	 public ReadFileInfoHelper()
     {
     }
     public static void main(String args1[])
     {
     }
     public static String getModifiedTimeAndSize(URL url)
         throws URISyntaxException, ZipException, IOException
     {

/*  61*/        Calendar cal = Calendar.getInstance();
         long time;
         long size;
/* <-MISALIGNED-> */ /*  62*/        if(url.getProtocol().equals("jar"))
         {

/*  67*/            String zip = url.getFile().split("!/")[0].substring(5);
/*  68*/            String zipEntry = url.getFile().split("!/")[1];
/*  69*/            ZipEntry entry = (new ZipFile(zip)).getEntry(zipEntry);
/*  70*/            time = entry.getTime();
/*  71*/            size = entry.getSize();
         } else
         {/*  73*/            File f = new File(url.getFile());
/*  74*/            time = f.lastModified();
/*  75*/            size = f.length();
         }
/*  77*/        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/*  78*/        cal.setTimeInMillis(time);
/*  79*/        return (new StringBuilder()).append(EASResource.getString("com.kingdee.eas.fm.common.COMMONAutoGenerateResource", "103_ReadFileInfoHelper")).append(formatter.format(cal.getTime())).append(EASResource.getString("com.kingdee.eas.fm.common.COMMONAutoGenerateResource", "104_ReadFileInfoHelper")).append(size).toString();
     }

}
